﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBMigrator.Core.DbObjects.Column;
using Xunit;

namespace DBMigrator.Core.Tests.DbObjects.Column
{
    public class DropColumnTests
    {
        [Fact]
        public void SqlGenerationTypeShouldReturnIDropColumn()
        {
            Assert.Equal(typeof(IDropColumn), new DropColumn("Name").SqlGenerationType);
        }

        [Fact]
        public void ConstructorShouldThrowIfNameIsNull()
        {
            Assert.Throws<ArgumentNullException>(() => new DropColumn(null));
        }

        [Fact]
        public void ConstructorShouldThrowIfNameIsBlank()
        {
            Assert.Throws<ArgumentNullException>(() => new DropColumn(string.Empty));
        }

        [Fact]
        public void ConstructorShouldSetName()
        {
            var name = StringUtil.Random();
            Assert.Equal(name, new DropColumn(name).Name);
        }
    }
}
